import { isEdge } from '@/utils'
import { getConfigApi } from './cloud/config.js'
import {
  getDeviceTags,
  getDevice,
  getEnergyMeter,
  getAlarmLatestState,
  getPowerDevice,
  getController,
  getDictionary,
  getDatapoolTsdb,
  postSqlData,
  submitOperationLog,
  getDeviceChannelTimeData,
  getAlarmListAPI,
  createOrUpdateData,
  setDeviceControl,
  getOperationLogAPI
} from './cloud/device.js'
import localApi from './jsapi'

const cloudApi = {
  getConfigApi,
  getDeviceTags,
  getDevice,
  getEnergyMeter,
  getAlarmLatestState,
  getPowerDevice,
  getController,
  getDictionary,
  getDatapoolTsdb,
  postSqlData,
  submitOperationLog,
  getDeviceChannelTimeData,
  getAlarmListAPI,
  createOrUpdateData,
  setDeviceControl,
  getOperationLogAPI
}

export default isEdge()
  ? {
      ...localApi
    }
  : {
      ...cloudApi
    }
